package com.wy2cloud.core.security.rsa;


/**
 * 加密类型:公钥加密、私钥加密
 * @author admin
 *
 */
public enum RSAEncryptTypeByKey {
  
	/**
	 * 私钥加密，公钥解密
	 */
	PrivateEncrypt(0),
	/**
	 * 公钥加密，私钥解密
	 */
	PublicEncrypt(1);
	
	private final int val;
	
	private RSAEncryptTypeByKey(int value) {
		this.val=value;
	}
	
	public int getValue() {
		return this.val;
	}
	
   public static RSAEncryptTypeByKey parse(int typeValue){
		
		for(RSAEncryptTypeByKey type:RSAEncryptTypeByKey.values()){
			if(type.val==typeValue)
				return type;
		}
		return RSAEncryptTypeByKey.PrivateEncrypt;
	}
}
